package io.cici.cc.mybatis.lite.executor.resultset;

public class ResultContextImpl<T> implements ResultContext<T> {

    private T resultSetObject;
    private int resultCount;
    private boolean stopped;

    public ResultContextImpl() {
        resultSetObject = null;
        resultCount = 0;
        stopped = false;
    }

    @Override
    public T getObject() {
        return resultSetObject;
    }

    @Override
    public int getCount() {
        return resultCount;
    }

    @Override
    public boolean isStopped() {
        return stopped;
    }

    public void nextResultObject(T resultObject) {
        resultCount++;
        this.resultSetObject = resultObject;
    }

    @Override
    public void stop() {
        this.stopped = true;
    }

}
